#include <iostream>
#include <vector>
#include "LinearRegression.h"
#include "GradientDescent.h"
#include "MyMatrix.h"

using namespace std;
using std::vector;

template <size_t N, size_t M>
void ThisIsAlsoLegal(double (&arr)[M][N])
{
	cout << M << endl;
}

void Test(double a[][3])
{

}

int main()
{
	int m = 3;
	double v[3] = {1,2,3};

	double v2[3][3] = {
		               {1, 2, 3},
					   {4, 5, 6},
	                   {7, 8, 9}
	                  };

	ThisIsAlsoLegal(v2);

	MyMatrix *vector = new MyMatrix(v, m);
	MyMatrix *vector2 = new MyMatrix(v, m);

	const size_t mSz = 3;
	const size_t nSz = 3;

	//MyMatrix *vector3 = new MyMatrix<mSz, nSz>(v2, 3, 3);

	vector->Add(4);
	vector->Subtract(4);
	vector->Multiply(4);
	vector->Divide(4);

	vector->Add(*vector2);
	vector->Subtract(*vector2);
	vector->Multiply(*vector2);
	vector->Divide(*vector2);
}

int main_gradientDescentTest()
{
	vector<double> x;
	x.push_back(3);
	x.push_back(2);
	x.push_back(4);
	x.push_back(0);

	vector<double> y;
	y.push_back(4);
	y.push_back(1);
	y.push_back(3);
	y.push_back(1);

	LinearRegression * lin = new LinearRegression(x, y);
	LinearRegression linA = *(lin);
	cout << "M: " << lin->M() << endl;

	double learningRate = 0.001, thetaZero = -2, thetaOne = 0.5;

	cout << "LearningRate: " << learningRate << endl;

	GradientDescent * calc = new GradientDescent(lin, thetaZero, thetaOne, learningRate);
	calc->Calculate();

	return 0; 
}
